import {Table} from "./table";
import {Player} from "./player";
import {app} from "mydog";
import skGamMgr from './shuangkou/GameMgr';
import nbddzGamMgr from './nbdoudizhu/GameMgr';
import {GameType} from "../util/gameUtil";

export interface I_gameMgr {
    init(table:Table,rule:{playerCount:number,rule?:string});
    update(dt);
    //是否能开始游戏
    canGameStart():boolean;
    //游戏开始通知
    onGameStart();
    //玩家进入桌子通知
    onEnterTable(player:Player);
    onReceiveMessage(player:Player,msg:{event:string,data:any});
}


let tmpMgr:any;
if(app.serverInfo.gameType==GameType.SK){
    tmpMgr = skGamMgr;
}else if(app.serverInfo.gameType==GameType.NB_DDZ){
    tmpMgr = nbddzGamMgr;
}

export const GameMgr = tmpMgr;